//
//  MenuShiCaiModel.m
//  Products_B
//
//  Created by lanou on 16/5/29.
//  Copyright © 2016年 朋学友. All rights reserved.
//

#import "MenuShiCaiModel.h"

@implementation MenuShiCaiModel
+ (NSMutableArray *)modelReturnPicStringWith:(NSDictionary *)json{
    NSMutableArray *picArray = [NSMutableArray array];
   NSArray *dataArray = json[@"data"][@"data"];
    for (NSDictionary *dataDic in dataArray) {
        [picArray addObject:dataDic[@"image"]];
    }
    return picArray;
}
+ (NSMutableArray *)modelReturnSectionNameWith:(NSDictionary *)json{
    NSMutableArray *sectionNameArray = [NSMutableArray array];
    NSArray *dataArray = json[@"data"][@"data"];
    for (NSDictionary *dataDic in dataArray) {
        [sectionNameArray addObject:dataDic[@"text"]];
    }
    return sectionNameArray;
}
+ (NSMutableDictionary *)modelConfigureWithDic:(NSDictionary *)json{
    NSMutableDictionary *shiCaiDic = [NSMutableDictionary dictionary];
    NSArray *dataArray = json[@"data"][@"data"];
    
    for (NSDictionary *dataDic in dataArray) {
        NSString *key = dataDic[@"text"];
        NSMutableArray *modelArray = [NSMutableArray array];
        NSArray *modelDataArray = dataDic[@"data"];
        for (NSDictionary *modelDataDic in modelDataArray) {
            MenuShiCaiModel *model = [[self alloc]init];
            [model setValuesForKeysWithDictionary:modelDataDic];
            [modelArray addObject:model];
        }
        [shiCaiDic setObject:modelArray forKey:key];
    }
    return shiCaiDic;
}
@end
